//
//  SLRootCollectionCell.m
//  Objective-C
//
//  Created by S_Line on 2018/5/4.
//  Copyright © 2018年 S_Line. All rights reserved.
//

#import "SLRootCollectionCell.h"

@interface SLRootCollectionCell()

@property (nonatomic, weak) UILabel *contentLabel;

@end

@implementation SLRootCollectionCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self initView];
}

- (void)initView {
    self.backgroundColor = [UIColor clearColor];
    self.contentView.backgroundColor = [UIColor clearColor];
    self.contentView.layer.borderWidth = 2;
    self.contentView.layer.borderColor = [[UIColor colorWithHexString:@"#dddddd"] CGColor];
    self.contentView.layer.cornerRadius = 5;
    
    UILabel *contentLabel = [UILabel new];
    contentLabel.font = [UIFont systemFont12];
    contentLabel.textColor = [UIColor colorWithHexString:@"#dddddd"];
    self.contentLabel = contentLabel;
    [self.contentView addSubview:contentLabel];
    [contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView.mas_centerX);
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];
    
}

- (void)setModelItem:(SLRootModelItem *)modelItem {
    _modelItem = modelItem;
    
    self.contentLabel.text = modelItem.name;
}

@end
